package com.funmi.lizip.entity;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;

import java.io.Serializable;

import com.funmi.lizip.common.model.BaseEntity;
import com.funmi.lizip.utils.ArrayJsonHandler;
import com.funmi.lizip.utils.ObjectJsonHandler;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 *
 * </p>
 *
 * @author yeyg
 * @since 2022-11-03
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "ec_patrol_track", autoResultMap = true)
public class PatrolTrack extends BaseEntity implements Serializable {

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 设备编号
     */
    private String equipmentNumber;

    /**
     * 护林员id
     */
    private String rangerId;

    /**
     * 巡护时间
     */
    private LocalDateTime patrolDate;

    /**
     * 轨迹json:['creteTime','location']
     */
    @TableField(value = "track_msg", typeHandler = ArrayJsonHandler.class)
    private JSONArray trackMsg;

    /**
     * 是否删除
     */
    @TableField(value = "is_delete",select = false)
    @TableLogic
    private Boolean delete;

    /**
     * 巡护任务Id
     */
    private String patrolId;


    /**
     * 巡护轨迹状态，1正在更新.  0.结束
     */
    private Boolean status;

    /**
     * 巡护轨迹距离，单位千米
     */
    private Double distance;

    // private LocalDateTime createAt;


}
